﻿<TestClass()>
Public Class DatabaseTypeHelperTest

    <TestMethod()>
    Public Sub LooksLikeParamTest_MsSql()
        Dim options As New QBuilder.QueryOptions
        options.DatabaseType = QBuilder.DatabaseType.MicrosoftSqlServer
        Assert.IsTrue(QBuilder.DatabaseTypeHelper.LooksLikeParam("@Time", options))
        Assert.IsFalse(QBuilder.DatabaseTypeHelper.LooksLikeParam("Field1", options))
    End Sub

    ''' <summary>
    ''' For now this should throw an exception.  Once access is supported it should test correctly
    ''' </summary>
    ''' <remarks></remarks>
    <TestMethod()>
    <ExpectedException(GetType(ArgumentException))>
    Public Sub LooksLikeParamTest_Access()
        Dim options As New QBuilder.QueryOptions
        options.DatabaseType = QBuilder.DatabaseType.Access
        Assert.IsTrue(QBuilder.DatabaseTypeHelper.LooksLikeParam("?", options))
        Assert.IsFalse(QBuilder.DatabaseTypeHelper.LooksLikeParam("Field1", options))
        Assert.IsFalse(QBuilder.DatabaseTypeHelper.LooksLikeParam("@Time", options))
    End Sub
End Class
